package com.madarasan.SkiDroid;

import android.os.Bundle;
import android.util.Log;
import android.widget.MediaController;
import android.widget.VideoView;

/*
 * public class VideoViewActivity extends Activity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        String videoUrl = "http://dragos.madarasan.com/ski/test.mp4";
        Intent i = new Intent(Intent.ACTION_VIEW);  
        i.setData(Uri.parse(videoUrl));  
        startActivity(i); 
	
	@Override
	public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	setContentView(R.layout.videoplayer);

	VideoView videoView = (VideoView) findViewById(R.id.videoView);
	MediaController mediaController = new MediaController(this);
	mediaController.setAnchorView(videoView);
	// Set video link (mp4 format )
	Uri video = Uri.parse("http://dragos.madarasan.com/ski/test.mp4");
	videoView.setMediaController(mediaController);
	videoView.setVideoURI(video);
	videoView.start();
	
	
	
}

}*/

public class ShowResortWebcam extends GlobalMenuActivity {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		Log.i("ShowResortWebcam", "onCreate called");

		setContentView(R.layout.videoplayer);

		//String link = ((MyApplication) this.getApplication()).getLink();

		String link = "android.resource://" + getPackageName() + "/" 
				+ R.raw.feleac; //do not add any extension
				//if your file is named sherif.mp4 and placed in /raw
				//use R.raw.sherif
		
		VideoView videoView = (VideoView) findViewById(R.id.videoView);

		MediaController mediaController = new MediaController(this);

		mediaController.setMediaPlayer(videoView);

		videoView.setVideoPath(link);

		videoView.setMediaController(mediaController);

		videoView.requestFocus();

		videoView.start();

		mediaController.show();

		/*
		 * MediaController mediaController = new MediaController(this);
		 * mediaController.setAnchorView(videoView); // Set video link (mp4
		 * format ) Uri video = Uri.parse("mp4link video ");
		 * videoView.setMediaController(mediaController);
		 * videoView.setVideoURI(video); videoView.start();
		 */

	}
}
